Skip to content

Reject a zero lower fpr_range bound in LogAUC - #3662

Open
chenyangsu wants to merge 3 commits into
Lightning-AI:masterfrom
chenyangsu:fix/logauc-zero-fpr-lower-bound
Open

chenyangsu wants to merge 3 commits into
Lightning-AI:masterfrom
chenyangsu:fix/logauc-zero-fpr-lower-bound

Conversation

@chenyangsu

Copy link
Copy Markdown

What does this PR do?

_validate_fpr_range accepts a lower bound of 0, but LogAUC takes log10 of the FPR, so binary_logauc(preds, target, fpr_range=(0.0, 0.1)) returns tensor(nan) with no warning. For multiclass and multilabel every class is nan, so the macro average is nan too.

The lower bound must now be greater than 0, and multilabel_logauc checks fpr_range like the binary and multiclass functions, which it skipped before.

Testing: the new test_logauc_rejects_zero_fpr_lower_bound fails on master for all three tasks and passes with the change; test_logauc.py: 260 passed, 24 skipped, 4 xfailed.

Before submitting
  • Was this discussed/agreed via a Github issue? (no need for typos and docs improvements)
  • Did you read the contributor guideline, Pull Request section?
  • Did you make sure to update the docs? (no docs change needed; the error message now says (0, 1])
  • Did you write any new necessary tests?
PR review

Anyone in the community is free to review the PR once the tests have passed.
If we didn't discuss your PR in Github issues there's a high chance it will not be merged.

Did you have fun?

Yes.

@chenyangsu
chenyangsu force-pushed the fix/logauc-zero-fpr-lower-bound branch from 8336831 to a29f223 Compare November 26, 2026 20:51

@atishay-kasliwal atishay-kasliwal left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

binary_logauc, multiclass_logauc and multilabel_logauc with an fpr_range starting at 0 now raise the ValueError; master returned nan. The default (0.001, 0.1) gives the same 0.6667 as master for all three.

@chenyangsu

Copy link
Copy Markdown
Author

Merged master to resolve the CHANGELOG.md conflict, and tests/unittests/classification/test_logauc.py passes (260 passed, 24 skipped, 4 xfailed).

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants